import { getPolylineGeometry } from './workerUtil'
onmessage = function (e) {
  const data = e.data
  const path = data.path
  const gisCenter = data.gisCenter

  const geometry = getPolylineGeometry(gisCenter, path)

  const positions = geometry.attributes.position.array
  const uvs = geometry.attributes.uv.array
  const facenormals = geometry.attributes.facenormal.array
  postMessage(
    {
      facenormals: facenormals,
      positions: positions,
      uvs: uvs
    },
    [facenormals.buffer, positions.buffer, uvs.buffer]
  )
}
